<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:decorate template="/resources/template/modelo.xhtml">
        <ui:define name="centro">
             
            <h:form>
                <p:dataTable value="#{livroBean.livros}" var="l" paginator="true" rows="10">
                    <p:column headerText="ID">
                        <h:outputText value="#{l.id}" />
                    </p:column>

                    <p:column headerText="Titulo" style="white-space: normal;">
                        <h:outputText value="#{l.titulo}" />
                    </p:column>

                    <p:column headerText="Autores" style="white-space: normal;">
                        <h:outputText value="#{l.autoresToString}" escape="false" />
                    </p:column>
                    
                    <p:column headerText="Formato" style="white-space: normal;">
                        <h:outputText value="#{l.formato.formato}" />
                    </p:column>

                    <p:column headerText="Ações" style="white-space: normal;">
                        <p:commandButton action="editar" actionListener="#{livroBean.selecionar()}" value="Editar" ajax="false" />
                        <p:commandButton action="/cadastros/obras/livros/remover/removerLivro.xhtml" actionListener="#{livroBean.selecionar()}" value="Remover" ajax="false" />
                    </p:column>
                </p:dataTable>

                

            </h:form>


        </ui:define>
    </ui:decorate>
</html>